-
Notifications
You must be signed in to change notification settings - Fork 5
Separate print, USB export related actions into their own classes #41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things that could be followups would be:
- see if we can make
SDExport.exit_gracefully
more standalone: I ended up not making autils.py
as theexit_gracefully
method is used almost everywhere, and part of its cleanup is removing the submission's tmpdir. So I'd either need to passtmpdir
around everywhere, which is messy, or just leave it as a method onSDExport
, which is what I elected to do for now. The fact this is used so widely is also what complicated removing thesubmission
from the test actions.
I agree that the preflight check Actions and PrintTestPageAction should not require a submission object. It seems like it makes more sense for there to be a Printer object with printer_uri etc that you can pass to printer Actions, and a DiskDrive object that you pass to disk transfer actions. I think it would make sense to create a followup discussion issue.
- combining usb-test and disk-test: I didn't do that here as I wanted to keep the inter-VM interface the same (i.e. no changes are needed in
securedrop-client
to merge this) but I think this would make sense to do.
I agree with this followup.
✔️ I made sure I could still print a file from a LaserJet Pro M404n printer and transfer a file to a usb disk drive.
this is more accurate since there are no _strict_ USB requirements in the current export code: removable block devices of other kinds can be exported to
thanks for the comments! agreed all around, added two commits (and did a quick retest of the USB export... i mean Disk export 😇) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Closes #33, breaks up the
SDExport
class, we now have:SDExport
(same name) which contains submission archive related information and helper methods, like the niceMetadata
object that was already on master*Action
objects, one for each type of export we support, which contain methods/attributes related to the export action in question. Each export action must implementrun()
.Two things that could be followups would be:
SDExport.exit_gracefully
more standalone: I ended up not making autils.py
as theexit_gracefully
method is used almost everywhere, and part of its cleanup is removing the submission's tmpdir. So I'd either need to passtmpdir
around everywhere, which is messy, or just leave it as a method onSDExport
, which is what I elected to do for now. The fact this is used so widely is also what complicated removing thesubmission
from the test actions.securedrop-client
to merge this) but I think this would make sense to do.Since I'm moving around the furniture, feel free to let me know if you don't like where things are @emkll & @creviera :-)
Test plan
I have tested the following with my HP LaserJet and a USB drive: